<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        #boxA {
            background-color: blue;
            padding: 5px;
        }
        #boxB {
            background-color: green;
            padding: 5px;
            overflow: auto;
        }
    </style>
</head>
<body>
<div id="boxA">
    <img src="images/2.2.a.jpg">
</div>
<input id="btn1" type="button" value="复制" >
<div id="boxB">

</div>
<script>
    var btn1Ojb = document.getElementById('btn1');
    btn1Ojb.onclick = function () {
        var boxA = document.getElementById('boxA');
        var boxB = document.getElementById('boxB');
        var img = boxA.firstElementChild.cloneNode();
        var div = document.createElement('div');
        div.style.float = 'left';
        var btn = document.createElement('input');
        btn.type = 'button';
        btn.value = "X";
        btn.onclick = function () {
            this.parentNode.parentNode.removeChild(this.parentNode);
        }

        if (img){
            div.appendChild(img);
            div.appendChild(btn);
            boxB.appendChild(div);
        }

    }


</script>
</body>
</html>